package cn.emove.modular.system.mapper;

import cn.emove.modular.system.entity.Meter;
import cn.emove.modular.system.model.MeterDto;
import cn.emove.modular.system.model.MeterLogDto;
import cn.emove.modular.system.model.MeterReadingDto;
import cn.stylefeng.roses.core.datascope.DataScope;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface MeterMapper extends BaseMapper<Meter> {
    /**
     * 根据条件查询缴费列表
     */
    Page<Map<String, Object>> selectMeters(@Param("page") Page page, @Param("dataScope") DataScope dataScope, @Param("meterNo") String meterNo, @Param("shopName") String shopName, @Param("shopAdr") String shopAdr, @Param("meterStatus") String meterStatus, @Param("meterType") String meterType,@Param("meterModel") String meterModel);

    Integer insertBatch(@Param("list") List<MeterReadingDto> list);

    MeterDto selectDataExist(@Param("meterNo") String meterNo);

    Integer updateBatch(String[] array, String status, String remark);

    Integer insertMeter(MeterDto meterDto);

    Integer insertMeterLog(MeterLogDto meterLogDto);

    Meter selectMeterById(@Param("id") int id);

    Integer updateMeter(MeterDto meterDto);

    Meter selectMeterByParam(@Param("meterNo") String meterNo, @Param("meterType") Integer meterType);

    List<MeterLogDto> selectMeterLogByMeterId(@Param("meterId") int id);

    Integer insertMeterBatch(@Param("list") List<MeterDto> list);

    Integer insertOrUpdate(MeterDto meter);

    Integer logicRemoveById(@Param("id") Integer id);

    Map selectContract(@Param("contractNo") String contractNo);
}
